package com.yunji.web.cabinet;

import com.yunji.cabinet.business.MaintainBusiness;
import com.yunji.cabinet.domain.TakeDeliveryDO;
import com.yunji.cabinet.params.RecordParam;
import com.yunji.cabinet.vo.MaintainDetailVO;
import com.yunji.cabinet.vo.MaintainVO;
import com.yunji.cabinet.vo.TakeDeliveryVO;
import com.yunji.common.base.response.Response;
import com.yunji.common.base.response.ResponseHelper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Project: yunji-coffee
 * @Package: com.yunji.web.cabinet
 * @Title: MaintainController
 * <p>
 * History:
 * Date                     Version     Author          Summary
 * ============================================================
 * 2024-11-01 14:53:57      V1.0        HuaAo       新建类
 */
@Api(tags = "管理端-货柜管理")
@RestController
@RequestMapping("/container/maintain")
public class MaintainController {

    @Resource
    MaintainBusiness business;

    @ApiOperation("补货记录列表")
    @PostMapping("/list")
    public Response<List<MaintainVO>> list(@RequestBody RecordParam param) {
        return ResponseHelper.successWithPage(business.searchPageList(param));
    }

    @ApiOperation("补货详情")
    @GetMapping("/getMaintainInfo/{maintainCode}")
    public Response<List<MaintainDetailVO>> maintainInfo(@PathVariable String maintainCode) {
        return ResponseHelper.success(business.getMaintainInfo(maintainCode));
    }

    @ApiOperation("取货记录列表")
    @PostMapping("/takeDeliveryList")
    public Response<List<TakeDeliveryVO>> takeDeliveryList(@RequestBody RecordParam param) {
        return ResponseHelper.successWithPage(business.takeDeliveryLIst(param));
    }

}